@extends('admin.base.parent')
@section('content')
<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li>
				<i class="icon-home home-icon"></i>
				<a href="#">主页</a>
			</li>

			<li>
				<a href="#">商品详情</a>
			</li>
			<li class="active">商品操作页</li>
		</ul><!-- .breadcrumb -->

		<div class="nav-search" id="nav-search">
			<form class="form-search" action="{{ url('admin/goods') }}" method='get'>
				<span class="input-icon">
					<input type="text" placeholder="查找" class="nav-search-input" id="nav-search-input" autocomplete="off" name='title'/>
					<i class="icon-search nav-search-icon"></i>
					<button type="submit" class="btn btn-purple btn-sm">
						查找
					<i class="icon-search icon-on-right bigger-110"></i>
					</button>
				</span>
			</form>
		</div><!-- #nav-search -->
	</div>

	<div class="page-content">
		<div class="page-header">
			<h1>
				商品详情页
				<small>
					<i class="icon-double-angle-right"></i>
					商品操作页
				</small>
			</h1>
		</div><!-- /.page-header -->

		<div class="row">
			<div class="col-xs-12">
				<!-- PAGE CONTENT BEGINS -->
		@if(session('msg'))
		 	<div class='alert alert-block alert-success'>
		 		{{ session('msg') }}
		 		<i class='icon'></i>
		 	</div>
		 @endif
		 @if(session('error'))
		 	<div class="alert alert-danger">
		 		{{ session('error') }}
		 		<i class='icon'></i>
		 	</div>
		 @endif
		 <form action="{{ url('admin/goods') }}" method='post' name='myform'>
			{{ csrf_field() }}
			{{ method_field('DELETE') }}
		</form>
				<div class="row">
					<div class="col-xs-12">
						<div class="table-responsive">
							<table id="sample-table-1" class="table table-striped table-bordered table-hover">
								<thead>
									<tr>
										<th class="center">
											<label>
												<input type="checkbox" class="ace" />
												<span class="lbl"></span>
											</label>
										</th>
										<th>商品编号</th>
										<th>商品名称</th>
										<th>商品价格</th>
										<th>商品图片</th>
										<th>
											<i class="icon-time bigger-110 hidden-480"></i>
											添加时间
										</th>
										<th class="hidden-480">推荐状态</th>
										<th>类别编号</th>
										<th>商品简介</th>
										<th>访问次数</th>
										<th>操作</th>
									</tr>
								</thead>

								<tbody>
									@foreach($list as $v)
									<tr>
										<td class="center">
											<label>
												<input type="checkbox" class="ace" />
												<span class="lbl"></span>
											</label>
										</td>

										<td>
											<a href="#">{{ $v->id }}</a>
										</td>
										<td>{{ $v->title }}</td>
										<td>{{ $v->price }}</td>
										<td><img src="{{ url('/admin/upload/'.$v->pic) }}" alt="" width="100px" height="100px"></td>
										<td>{{ date('Y-m-d H:i:s',$v->posttime) }}</td>
										<td>{{ $v->recommend }}</td>
										<td>{{ $v->cid }}</td>
										<td>{{ $v->summary }}</td>
										<td>{{ $v->views }}</td>

										<td>
											<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
												<a class="btn btn-xs btn-info" href="{{ url('admin/goods').'/'.$v->id}}/edit">
													<i class="icon-edit bigger-120"  >&nbsp;修改</i>
												</a>

												<a class="btn btn-xs btn-danger" href='javascript:doDel({{ $v->id }})' >
													<i class="icon-trash bigger-120" >&nbsp;删除</i>
												</a>
											</div>
										</td>

											<div class="visible-xs visible-sm hidden-md hidden-lg">
												<div class="inline position-relative">
													<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
														<i class="icon-cog icon-only bigger-110"></i>
													</button>

													<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
														<li>
															<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
																<span class="blue">
																	<i class="icon-zoom-in bigger-120"></i>
																</span>
															</a>
														</li>

														<li>
															<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
																<span class="green">
																	<i class="icon-edit bigger-120"></i>
																</span>
															</a>
														</li>

														<li>
															<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
																<span class="red">
																	<i class="icon-trash bigger-120"></i>
																</span>
															</a>
														</li>
													</ul>
												</div>
											</div>
										</td>
									</tr>
									@endforeach
								</tbody>
							</table>
							{{ $list->appends($where)->links() }}
						</div><!-- /.table-responsive -->
					</div><!-- /span -->
				</div><!-- /row -->
				<div class="hr hr-18 dotted hr-double"></div>
			</div><!-- /.col -->
		</div><!-- /.row -->
	</div><!-- /.page-content -->
</div><!-- /.main-content -->
<script>
	function doDel(id){
		if(confirm('确定删除吗？')){
			var form = document.myform;
			form.action = '/admin/goods/'+id;
			form.submit();
		}
	}
</script>
@endsection